package com.joe.codemother.service;

import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.joe.codemother.entity.ChatHistory;
import com.mybatisflex.core.query.QueryWrapper;

/**
 * 对话历史 服务层。
 *
 * @author joe
 */
public interface ChatHistoryService extends IService<ChatHistory> {

	boolean saveUserMessage(Long appId, Long userId, String message);

	boolean saveAiMessage(Long appId, Long userId, String message);

	boolean saveError(Long appId, Long userId, String errorMessage);

	QueryWrapper buildUserAppQueryWrapper(Long appId, Long userId);

	Page<ChatHistory> pageAdmin(int pageNum, int pageSize, Long appId, Long userId);
}
